package eteam.aps.common;

public class R<T> {
    private T data;
    private int code = 200;
    private String msg;

    public static <ResultType> R<ResultType> success(ResultType data) {
        R<ResultType> result = new R<>();
        result.data = data;
        return result;
    }

    public static  <ResultType> R<ResultType> success() {
    	R<ResultType> result = new R<>();
        return result;
    }

    public static  <ResultType> R<ResultType> failed(int code, String message) {
    	R<ResultType> result = new R<>();
        result.code = code;
        result.msg = message;
        return result;
    }

    public T getData() {
        return data;
    }

    public int getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }
}
